<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="model.*"%>
<%@ page import="dao.*"%>
<%@ page import="java.util.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setCharacterEncoding("utf-8");
	response.setCharacterEncoding("utf-8");
	String user = (String)session.getAttribute("user");
	if(user!=null && user.equals("1")){
		
	}else {
		response.sendRedirect("Login.jsp");
	}
%>
<%
	request.setCharacterEncoding("utf-8");
	response.setCharacterEncoding("utf-8");
	String nid = request.getParameter("nid");
	New new1 = new New();
	new1 = NewDao.getNewNoCache(Integer.parseInt(nid));
	if (new1 != null) {
		request.setAttribute("new1", new1);
	} else {
		new1 = new New();
		request.setAttribute("new1", new1);
	}
%>
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8" />
<title>管理旅游景点</title>


<jsp:include page="Header.jsp" flush="true"></jsp:include>


<!-- Latest Products -->
<div id="修改旅游新闻">
	<div class="content-lg container">
		<div class="row margin-b-40">
			<div class="col-sm-6">
				<h2>修改旅游新闻</h2>
				<p></p>
			</div>
		</div>
		<!--// end row -->

		<div class="row">
			<form role="form" action="<%=request.getContextPath()%>/NewServlet"
				method="post">
				<div class="col-xs-6">

					<div class="col-xs-12">
						<div class="form-group"><!-- request域中接受到对象 -->
							<label for="name">name</label> <input value="${new1.name }"
								name="name" type="text" class="form-control">
						</div>
					</div>

		
					
					<div class="col-xs-12">
						<div class="form-group">
							<label for="name">info</label>
							<textarea style="height: 100px" class="form-control" name="info">${new1.info }</textarea>
						</div>
					</div>

					<div class="col-xs-12">
						<div class="form-group">
							<label for="name"></label> <input value="updateNew" name="handle"
								type="hidden" class="form-control">
						</div>
					</div>

					<div class="col-xs-12">
						<div class="form-group">
							<label for="name"></label> <input value="${new1.id }" name="nid"
								type="hidden" class="form-control">
						</div>
					</div>

					<div class="col-xs-12">
						<div class="col-xs-6"></div>
						<div class="col-xs-6">
							<div class="form-group">
								<input style="width: 200px;" type="submit"
									class="btn btn-default " value="修改">
							</div>
						</div>
					</div>

				</div>
				<div class="col-xs-6">
					<img style="margin-left: 70px;" alt=""
						src="<%=request.getContextPath()%>/img/ng1.png">
				</div>


				<div class="col-xs-12"></div>


			</form>
		</div>
		<!--// end row -->
	</div>
</div>
<!-- End Latest Products -->

<jsp:include page="Footer.jsp" flush="true"></jsp:include>
<%
	String flag = "";
	String scerror = "";
	flag = (String) request.getAttribute("flag");
	System.out.println("jspflag" + flag);
	if (flag != null) {
		if (flag.equals("1")) {
			scerror = "删除成功。";
			out.print("<script language='javascript'>alert('" + scerror + "');</script>");
		}
		if (flag.equals("0")) {
			scerror = "删除失败。";
			out.print("<script language='javascript'>alert('" + scerror + "');</script>");
		}

	}
	System.out.println(scerror);
%>
<!-- Back To Top -->
<a href="javascript:void(0);" class="js-back-to-top back-to-top">Top</a>

<!-- JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- CORE PLUGINS -->
<script src="vendor/jquery.min.js" type="text/javascript"></script>
<script src="vendor/jquery-migrate.min.js" type="text/javascript"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"
	type="text/javascript"></script>
</body>
<!-- END BODY -->
</html>